//
//  FWComCell.m
//  BirdLoveSheep
//
//  Created by wwj on 16/3/30.
//  Copyright © 2016年 wwj. All rights reserved.
//

#import "FWComCell.h"
#import "FWTopComment.h"
#import "UIImageView+Extension.h"

static NSString *const SexMale = @"m";
static NSString *const SexWomn = @"f";

@interface FWComCell ()
@property (weak, nonatomic) IBOutlet UIImageView *profileImageView;
@property (weak, nonatomic) IBOutlet UIImageView *sexView;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *usernameLabel;
@property (weak, nonatomic) IBOutlet UILabel *likeCountLabel;
@property (weak, nonatomic) IBOutlet UIButton *voiceButton;
@end
@implementation FWComCell


- (void)setModel:(FWTopComment *)model{
    _model = model;
    [self.profileImageView fw_setImage:[NSURL URLWithString:model.user.profile_image]];
    self.sexView.image = [model.user.sex isEqualToString:SexMale] ? [UIImage imageNamed:@"Profile_manIcon"] : [UIImage imageNamed:@"Profile_womanIcon"];
    self.contentLabel.text = model.content;
    self.usernameLabel.text = model.user.username;
    self.likeCountLabel.text = [NSString stringWithFormat:@"%zd", model.like_count];
}

- (BOOL)canBecomeFirstResponder{
    return YES;
}

@end
